#ifndef VISIONMANAGER_H
#define VISIONMANAGER_H

#include <QObject>
#include <QString>
#include <QImage>
#include <QFile>
#include <QDebug>
#include <coreai/vision/textrecognition.h>

class VisionManager : public QObject
{
    Q_OBJECT
public:
    explicit VisionManager(QObject *parent = nullptr);
    ~VisionManager();
    bool initialize();
    void recognizeImage(const QString &imagePath);
    void recognizeImage(const QImage &image);
    QString lastRecognitionResult;

signals:
    void recognitionStarted();
    void recognitionFinished(const QString &text);
    void recognitionError(const QString &error);

private:
    TextRecognitionSession *visionSession;
    TextRecognitionModelConfig *visionConfig;

    static void recognitionCallback(TextRecognitionResult *result, void *user_data);
};

#endif // VISIONMANAGER_H
